home *** CD-ROM | disk | FTP | other *** search
-
- function StackerCinematic()
-
- local CinemaInvader = G.CreateAt( "Stacker", Vector3( 125, 0, 130 ) );
- CinemaInvader.TurnOffAI()
-
- Camera.CinemaMove( Vector3(170,15,170), Vector3(126,10,130), 2 );
- --Camera.CinemaLookAt( CinemaInvader );
- GameWait(2)
-
- G.SayPhraseScript( "Must attack ..." , CinemaInvader );
- GameWait(2)
-
- G.SayPhraseScript( "But So Tired ..." , CinemaInvader );
- CinemaInvader.ChangeStateScript( 5 ); -- Special
- TraitorTalk( "Lazy Stackers. They're big, but they don't do much. Most invaders just hop over them to get past walls. " );
- GameWait(2)
-
- -- Stacker is sleeping
- G.SayPhraseScript( "Zzzz" , CinemaInvader );
- GameWait(5)
-
- -- Drop a rock on him
- local invPos = CinemaInvader.GetPosition();
- G.CreateAt( "WallChunk", invPos + Vector3(1,25,-0.5) );
- GameWait(1)
-
- G.SayPhraseScript( "Oww." , CinemaInvader );
- GameWait(1)
-
- CinemaInvader.ChangeStateScript( 1 ); -- Stopped
- CinemaInvader.TurnOnAI()
- GameWait(2)
- end
-
-
- --Common Level Start Code
- function LevelStartup()
-
- G.Create( "MenuData/HudCog.xml" );
- G.Create( "Data/GameCamera.xml" );
- G.Create( "Data/CursorCog.xml" );
-
- MainLevel = G.Create( "Data/Levels/Campaign3.xml" );
- MainLevel.CreateLevel();
-
- G.SetInvSpeed( 20 );
- HUD.EnterLevel();
- G.SetGameState( InLevel );
- G.EarnPoints( 100 );
- G.SetMaxKills(0);
-
- G.SetLightTime( 5 );
- G.PostP( "None" );
-
- -- gameStartTime = 10000000;
-
- HUD.Message( "VictoryCondition" , "SetText", "Survive the Stacker Invasion!" );
- HUD.Message( "LossCondition" , "SetText", "If the Tower falls you lose." );
-
- TraitorCanBeHidden = true
-
- G.DisableTrapAll()
-
- G.EnableTrap("wall");
- G.EnableTrap("fan");
- G.EnableTrap("spring");
- G.EnableTrap("hammer");
-
- --TraitorTalk(" ");
- end
-
- LevelStartup()
-
- function LevelIntro()
-
- local tempPos = Tower.GetPosition()
- Camera.LookAtPosition( tempPos )
-
- gameStartTime = GameTime;
-
- ColorTextPopup( "Level 3: Special Delivery", Color(1,1,1,1) )
-
- DisableTraitor()
- GameWait(1.5)
-
- -- StartCinematic();
- -- StackerCinematic()
- -- EndCinematic();
-
- TraitorTalk("Hey, good morning! Do you like the new setup?");
- GameWait(6)
- TraitorTalk("I think I put some walls in front of fans by mistake.");
- GameWait(6)
- TraitorTalk("Well, those Bombers yesterday gave me an idea ...");
- GameWait(6)
-
- ColorTextPopup( "New Tool: Bombs!", Color(0.25,0.25,1,1) )
- G.EnableTrap("bomb");
-
- TraitorTalk("These bombs can destroy misplaced traps!");
- GameWait(6)
-
- TraitorTalk("Just hover over the trap, and Click to drop a bomb.");
- GameWait(6)
-
- TraitorTalk("Bombs aren't great versus invaders though.");
- GameWait(6)
-
- TraitorTalk("Look out, I see some invaders coming now!");
-
- -- DisableTraitor()
-
- -- TraitorTalk("Yeah, I couldn't sleep, so I got workin'. Pretty good defenses huh?");
- -- GameWait(7)
- -- TraitorTalk("I'm pretty pleased with myself. Lets see 'em get through this!");
- -- GameWait(7)
- -- TraitorTalk("Oh, I see some coming now! This should be fun.");
-
- end
-
- function LevelSequence()
-
- -- 1st Have a tower and some walls and let the Basic guys attack.
- Traitor.SetGuiPosition( "TraitorWindow" , Vector3(0.6, -0.5, 1) );
-
- -- Start Spawning thr guys
- BasicWave = createSpawnStruct()
-
- BasicWave.Prob.Basic = 2.0;
- BasicWave.Prob.Miner = 1.0;
-
- BasicWave.SpawnSpeed = 0.75;
- BasicWave.MaxSpawn = 15;
- BasicWave.TotalSpawn = 15;
- BasicWave.GroupPercent = 0.15;
- BasicWave.GroupSize = 1;
- BasicWave.WhereToSpawn = SmallCircleAroundTower
-
- --AddWave( "BasicAttack", BasicWave );
-
- -- Stacker Wave
- StackerWave = createSpawnStruct()
- StackerWave.Prob.Stacker = 1.5;
-
- StackerWave.SpawnSpeed = 5.0;
- StackerWave.MaxSpawn = 20;
- StackerWave.TotalSpawn = 19;
- StackerWave.GroupPercent = 0.95;
- StackerWave.GroupSize = 1;
- StackerWave.WhereToSpawn = CircleAroundTower
-
-
- AddWave( "BasicAttack", BasicWave )
- G.SetMaxKills(15);
-
- InvadersKilledWait( 15 )
-
- TraitorTalk("What'd I tell ya? The perfect defense!")
- GameWait(5)
- TraitorTalk("... Hey, what's that? Did you hear something?")
- GameWait(6)
-
- StartCinematic();
- StackerCinematic()
- EndCinematic();
-
- InvaderTextPopup( "Stacker" );
- GameWait(1)
-
- -- TraitorTalk("Oh no, they've brought Stackers!")
- -- GameWait(4)
- TraitorTalk("They're so heavy, our fans will have no effect on them!")
- GameWait(6)
-
- BasicWave.Prob.Stacker = 1.0;
- BasicWave.Prob.Spiker = 1.5;
- BasicWave.TotalSpawn = 25;
-
- AddWave( "StackerAttack", StackerWave )
- G.SetMaxKills(60);
-
- TraitorTalk("These guys are pretty tough too; they'll survive the fall from a spring trap.")
- GameWait(6)
- TraitorTalk("Place some more hammers, and I'll try to find a new trap.")
-
- InvadersKilledWait(55)
- TraitorTalk("Not many left! Check the Radar for stackers, they might be hiding!");
- WaitForClearEnemies( )
-
-
- TraitorTalk("Here are the blueprints for the spinning axe trap.")
- GameWait(3)
-
- G.EarnPoints( 70 );
- TrapTextPopup("Spinning Axe")
- G.EnableTrap("axe");
- GameWait(4)
- TraitorTalk("This Axe trap will damage invaders, and toss them around." )
- GameWait(7)
- --TraitorTalk("Be sure to watch its energy gauge, they wear down over time.")
- TraitorTalk("Place some near the Tower to keep the Stackers away.")
- GameWaitOrMoney(20)
-
- BasicWave.TotalSpawn = 30;
- StackerWave.TotalSpawn = 25;
-
- G.SetMaxKills(115);
-
- TraitorTalk("Looks like there's just one last group!")
-
- InvadersKilledWait(115)
- TraitorTalk("Almost all ...");
- WaitForClearEnemies( )
-
- TraitorTalk("Wow, I guess there's no such thing as a perfect defense after all.");
- GameWait(7)
-
- G.SetGameState( Victory );
-
- TraitorTalk("Get some rest and we'll see what lies in store for us tomorrow.");
- GameWait(7)
- TraitorTalk("Live and learn, huh? Well, its been a long day.");
- GameWait(6)
-
- --[[
- TraitorTalk("Arrgh! That was brutal.")
- GameWait(4)
- TraitorTalk("I know!")
- GameWait(2)
- ColorTextPopup( "New Trap: Poison Mist!", Color(0,0,0.85,1) )
- G.EnableTrap("poison");
- G.EarnPoints( 25 )
- GameWait(3)
- TraitorTalk("Whew! That's better. These poison mist traps should help out.")
- GameWait(5)
- TraitorTalk("It produces clouds of poison that slowly kills anyone who inhales it.")
- GameWait(6)
- TraitorTalk("The clouds can be blown around by fans, and even picked up!")
- GameWait(5)
-
- WaitForTimeOrKills( 500, 120 )
- WaitForClearEnemies( 20 )
- BasicWave.TotalSpawn = 50
-
- TraitorTalk("Oh, I almost forgot: these bombs should come in handy.")
- GameWait(3)
- ColorTextPopup( "New Trap: Bombs!", Color(0,0,0.85,1) )
- G.EnableTrap("bomb");
- GameWait(3)
-
- TraitorTalk("If you drop one onto a trap, it'll get rid of it instantly.")
- GameWait(5)
- TraitorTalk("You can even use them to take out invaders as they come.")
- GameWait(5)
- TraitorTalk("Try it out on some Stackers once they settle down by a wall.")
- GameWait(6)
-
- WaitForTimeOrKills( 500, 170 )
- StopWave( "StackerAttack" )
- WaitForClearEnemies( 10 )
-
- TraitorTalk("Good job, that seemed to do the trick!")
- StopWave( "BasicAttack" )
- --StopWave( "KamiAttack" )
- GameWait(3)
- ]]--
-
-
- end
-
- levelRoutine = coroutine.create(LevelIntro);
-
- GMain["LevelUpdate"] = LevelUpdate;
-